<template>
	<view>
		<view class="status_bar"></view>
		<view class="navBarBox">
			<view class="navBar">
				<!-- <view @click="bindPickerChange">选择班级</view> -->
				<picker :range="classList" :value="index" @change="bindPickerChange">
					<view>{{classList[index]}}</view>
					<view class="triangle"></view>
				</picker>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		name: "navbar",
		data() {
			return {
				classList: ['一年1班', '一年4班', '二年1班', '三年3班', '三年4班'],
				index: 0
			};
		},
		methods: {
			bindPickerChange(e) {
				console.log(e.target.value)
				this.index = e.target.value
			}
		}

	}
</script>

<style scoped>
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
		background-color: #FFFFFF;
	}

	.navBarBox {
		height: 30px;
		background-color: #FFFFFF;
		padding: 7px 3px;
	}

	.navBarBox .navBar {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		line-height: 30px;
	}
	.navBar view{
		float: left;
	}

	.navBar .triangle {
		width: 0px;
		height: 0px;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-top: 8px solid #000000;
		border-bottom: 6px solid transparent;
		margin-top: 12px;
		margin-left: 8px;
	}
</style>
